{if $bLogged}
{if $useAjax}
	<script type="text/javascript">
	{literal}
	function submitComment()
	{
		if (typeof(updateAd) != 'undefined')
		{
			updateAd();
		}
		sId('comment_submit_button').disabled=true;
		if ( typeof(tinyMCE) != 'undefined' )
		{
			tinyMCE.triggerSave(false, false);
			tinyMCE.execCommand('mceSetContent',false, '');
		}
		new Effect.Appear('ajax_main_image_cm');
		xajax_newEventComment(xajax.getFormValues("commentForm"));
		if ( typeof(tinyMCE) == 'undefined' )
		{
			sId('maintext').value='';		
		}
		return false;
	}
	{/literal}
	</script>
{/if}
<div>
{if $bLogged}
	{messages block='add-comment' error_var='aErrors2'}
	{if !$useAjax }
		<form method="post" action="{url link='current' type='event' cid=$iEventId}" style="margin:0px;">
		<div><input type="hidden" name="val[alert_id]" value="7" /></div>
	{else}
		<form id="commentForm" method="post" action="javascript:void(null);" onsubmit="submitComment();">
		<div><input type="hidden" name="alert_id" value="7" /></div>
		<div><input type="hidden" name="ajax_id" value="{$iEventId}" /></div>
		<div><input type="hidden" name="ajax_type" value="event" /></div>
		<div class="ajax_message" id="ajax_main_image_cm" style="display:none; font-size:10pt; font-weight:bold;">
			<img src="design/pic/loader.gif" alt="" style="vertical-align:middle;" /> <span id="ajax_comment_info">{language text="comment.being.added"}</span>
		</div>
	{/if}
	<div id="ajax_main_form" style="font-size:10pt;">
		<div style="padding-bottom:4px;"><b><label for="maintext">{language text="your_comment"}:</label></b></div>
		<div><textarea cols="60" rows="10" style="width:90%;" name="val[text]" id="maintext" onfocus="this.style.backgroundColor='#fff';" onblur="this.style.backgroundColor='#F6F6F6';">{$aValues.text}</textarea></div>
		<div style="padding-top:4px;">
			<div>
				{include file="$sMainTemplatePath/_blocks/smilies.html"}			
			</div>
			<input id="comment_submit_button" type="submit" name="act[comment]" value="{language text='submit_comment'}" class="mainmenu6" onmouseover="this.className='mainmenu7';" onmouseout="this.className='mainmenu6';" onclick="if (document.getElementById('formhide1')) {literal}{{/literal} document.getElementById('formhide1').style.display='none';document.getElementById('formhide2').style.display=''; {literal}}{/literal}" />
		</div>
	</div>
	</form>
	<br />
{/if}
{else}
	<div style="font-size:10pt;">
		<a class="link_action" href="{url link='public.login'}">[ {language text="login_to_post_a_comment"} ]</a>
	</div>
{/if}
</div>



